<?php
/**
 * Medical Study Object
 * To be use has a short cut
 *
 */
use Nawa\MedicalStudy;
$xview = Xview::instance();
$id = isset($params['msid']) ? $params['msid'] : $xview->val('msid');
$allowVoid = isset($params['allowVoid']) ? $params['allowVoid'] : false;
if(empty($id) && !$allowVoid)
{
	$xview->accessDenied();
}
try {
	$ms = new MedicalStudy($id);
	return $ms;
}
catch (Fox\Object\Exception\NotExist $e)
{
	if($allowVoid) {
		$ms = new MedicalStudy();
		return $ms;
	} else {
		$xview->accessDenied();
	}
}